package com.vinjune.redislock;

import com.alibaba.fastjson.JSON;

/**
 * Created by 000376 on 2017/9/4.
 */
public class Util {
    public static String beanToJson(Object o) {
        return JSON.toJSONString(o);
    }

    //parse an object from
    public static <T> T jsonToBean(String json, Class<T> cls) {
        return JSON.parseObject(json, cls);
    }
}
